<%-- 
    Document   : newpolladmin
    Created on : Aug 18, 2011, 9:46:12 PM
    Author     : s4201567 Tony Yu
--%>

<style type="text/css">
    .errors { color: red; }
    
    #pa-list {
        padding-left: 80px;
    }
    
    #syshome-title {
        text-align:center;
    }
    
   .sysadmintable {
    font-family:"Trebuchet MS", Arial, Helvetica, sans-serif;
    width:80%;
    border:1px solid #009933;
    text-align:center;
    }
    .sysadmintable td, .sysadmintable th .sysadmintable tr {
    font-size:1em;    
    border:1px solid #009933;
    padding:3px 7px 2px 17px;
    }
    .sysadmintable th {
    font-size:1.1em;
    text-align:center;
    padding-top:5px;
    padding-bottom:4px;
    background-color:#008833;
    color:#ffffff;
    }
</style>

<script language="JavaScript">
    function deactivate(id) {
        window.location="managePA.html?pid="+id;
    }
</script>

<%@ include file="../header.jsp" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <div id="content-container1">
        <div id="content">
            <div id="syshome-title">
                <h3>List of Active Administrator Accounts</h3>
            </div>
            <% int count = 0; %>
            <div id="pa-list">
              <table class="sysadmintable">
                <tr>
                    <th>Poll Administrator ID</th>
                    <th>Manage Details</th>
                    <th>Deactivate Account</th>
                </tr>
                <tr>          
                <c:forEach items="${active}" var="admin">     
                    <tr>
                       <c:if test="${admin != 0}">
                            <% 
                                count++;
                            %>
                            <td>${admin}</td>
                            <td><a href="managePADetails.html?pid=<c:out value="${admin}"/>">View</a></td>
                            <td><button onclick="deactivate(${admin})">Deactivate</button></td>
                       </c:if>
                    </tr>
                </c:forEach>
                </tr>
              </table>   
              <br/>
              <div id="msg">                   
                  <%
                    if (count == 0) {
                  %>
                  <font color="red">There are no activate accounts!</font>
              <% } %>
              </div>
                
              <br/>
              <form>
                  <input type="button" onClick="window.location.href='../index.html'" value="Create New Poll Administrator"/>
              </form>
              <form>
                  <input type="button" onClick="window.location.href='../sysadmin/reactivatePA.html'" value="Reactivate New Poll Administrator"/>
              </form>
            </div>
              <br/>
        </div>
    </div>		
		<%--onclick="remove(${polls.getPollCreatorID()},${polls.getID()})--%>
<%@ include file="../footer.jsp" %>                   
